package com.microtf.inscription.framework.vo.blog;

import com.microtf.inscription.framework.annotation.FieldAnnotation;
import com.microtf.inscription.framework.annotation.FormAnnotation;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 文章po
 */
@Getter
@Setter
@FormAnnotation(method = "post",value = "文章编辑")
@NoArgsConstructor
public class PostVo {
    @NotBlank(message = "标题不能为空")
    @Length(min = 4, message = "标题至少长度为四个字符")
    @FieldAnnotation(title = "标题", order = 1)
    String title;
    @NotBlank(message = "文章内容不能为空")
    @FieldAnnotation(title = "内容", order = 3, htmlEditorUpload = true,largeText = true)
    String cont;
    @FieldAnnotation(title = "发布到前台", order = 4)
    String state="publish";
    @NotEmpty
    @FieldAnnotation(title = "类别", order = 2, listBeanName = "categoryService",listMethod = "getAllCategory",multiple = true)
    String[] catNames;
    @NotNull(message = "作者不能为空")
    @Min(value = 1, message = "用户不合法")
    Long authorId;
    @FieldAnnotation(title = "文章ID", hide = true)
    Integer postId;
    Date createDate;
    Date updateDate;
    @FieldAnnotation(title = "博客ID", hide = true)
    Integer blogSpaceId;
}
